# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudDebugger.V2.Model.Debuggee do
  @moduledoc """
  Represents the debugged application. The application may include one or more replicated processes executing the same code. Each of these processes is attached with a debugger agent, carrying out the debugging commands. Agents attached to the same debuggee identify themselves as such by using exactly the same Debuggee message value when registering.

  ## Attributes

  *   `agentVersion` (*type:* `String.t`, *default:* `nil`) - Version ID of the agent. Schema: `domain/language-platform/vmajor.minor` (for example `google.com/java-gcp/v1.1`).
  *   `canaryMode` (*type:* `String.t`, *default:* `nil`) - Used when setting breakpoint canary for this debuggee.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Human readable description of the debuggee. Including a human-readable project name, environment name and version information is recommended.
  *   `extSourceContexts` (*type:* `list(GoogleApi.CloudDebugger.V2.Model.ExtendedSourceContext.t)`, *default:* `nil`) - References to the locations and revisions of the source code used in the deployed application.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Unique identifier for the debuggee generated by the controller service.
  *   `isDisabled` (*type:* `boolean()`, *default:* `nil`) - If set to `true`, indicates that the agent should disable itself and detach from the debuggee.
  *   `isInactive` (*type:* `boolean()`, *default:* `nil`) - If set to `true`, indicates that Controller service does not detect any activity from the debuggee agents and the application is possibly stopped.
  *   `labels` (*type:* `map()`, *default:* `nil`) - A set of custom debuggee properties, populated by the agent, to be displayed to the user.
  *   `project` (*type:* `String.t`, *default:* `nil`) - Project the debuggee is associated with. Use project number or id when registering a Google Cloud Platform project.
  *   `sourceContexts` (*type:* `list(GoogleApi.CloudDebugger.V2.Model.SourceContext.t)`, *default:* `nil`) - References to the locations and revisions of the source code used in the deployed application.
  *   `status` (*type:* `GoogleApi.CloudDebugger.V2.Model.StatusMessage.t`, *default:* `nil`) - Human readable message to be displayed to the user about this debuggee. Absence of this field indicates no status. The message can be either informational or an error status.
  *   `uniquifier` (*type:* `String.t`, *default:* `nil`) - Uniquifier to further distinguish the application. It is possible that different applications might have identical values in the debuggee message, thus, incorrectly identified as a single application by the Controller service. This field adds salt to further distinguish the application. Agents should consider seeding this field with value that identifies the code, binary, configuration and environment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :agentVersion => String.t() | nil,
          :canaryMode => String.t() | nil,
          :description => String.t() | nil,
          :extSourceContexts =>
            list(GoogleApi.CloudDebugger.V2.Model.ExtendedSourceContext.t()) | nil,
          :id => String.t() | nil,
          :isDisabled => boolean() | nil,
          :isInactive => boolean() | nil,
          :labels => map() | nil,
          :project => String.t() | nil,
          :sourceContexts => list(GoogleApi.CloudDebugger.V2.Model.SourceContext.t()) | nil,
          :status => GoogleApi.CloudDebugger.V2.Model.StatusMessage.t() | nil,
          :uniquifier => String.t() | nil
        }

  field(:agentVersion)
  field(:canaryMode)
  field(:description)

  field(:extSourceContexts,
    as: GoogleApi.CloudDebugger.V2.Model.ExtendedSourceContext,
    type: :list
  )

  field(:id)
  field(:isDisabled)
  field(:isInactive)
  field(:labels, type: :map)
  field(:project)
  field(:sourceContexts, as: GoogleApi.CloudDebugger.V2.Model.SourceContext, type: :list)
  field(:status, as: GoogleApi.CloudDebugger.V2.Model.StatusMessage)
  field(:uniquifier)
end

defimpl Poison.Decoder, for: GoogleApi.CloudDebugger.V2.Model.Debuggee do
  def decode(value, options) do
    GoogleApi.CloudDebugger.V2.Model.Debuggee.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudDebugger.V2.Model.Debuggee do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
